<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #app {
            border: 3px solid #efbc76;
            color: #c1610c;
            background-color: #ffe7d0;
            padding: 10px;
            border-radius: 20px;
            border-radius: 10px;
        }

        .title {
            line-height: 30px;
            background-color: #ffe7d0;
            text-align: center;
            margin-bottom: 20px;
            box-shadow: 0 5px 5px 4px -2px #f6c9a5;
            box-sizing: border-box;
        }

        .list .item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: #ffffff;
            box-sizing: border-box;
            padding: 15px;
            margin-bottom: 20px;
            border-radius: 10px;
            box-shadow: 0px 8px 0px 2px #f6c9a5;
        }

        .list .item img {
            width: 50px;
        }
        .list .item .name{
            font-size: 16px;
            font-weight: 700;
            color: #c05d06;
        }
        button{
            width: 50px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            color:#d05702;
            background-color: #fdeb6e;
            border-radius: 10px;
            border: 0;
            box-shadow: 5px 5px 5px #b66405;
            background-image: linear-gradient(to bottom,#fdeb6e,#ffaf25);
        }
        .desc{
            font-size: 12px;
            font-weight: 700;
            color: #c2620e;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="title">
            <h3>任务列表</h3>
            <p>每完成一个任务,即可获得10MB~1GB流量哦!
            </p>
        </div>
        <div class="list">
            <div class="item" v-for="(item,index) in tasklist" v-bind:key="index">
                <div class="left">
                    <img v-bind:src="item.pic" alt="">
                </div>
                <div class="center">
                    <div class="name">{{item.name}}</div>
                    <div class="desc">{{item.desc}}</div>
                </div>
                <div class="right">
                    <button>{{item.status == 1?'去完成':(item.status == 2?'领取':'已领取')}}</button>
                </div>
            </div>
        </div>
    </div>
</body>

</html>
<script src="../vue-2.5.21.js"></script>
<script>
    // 实例化一个对象
    var x = new Vue({
        // 这个位置放置vuejs规定的一些选项（这些选项得名字是规定的，另外这些选项是可选得）
        el: '#app',//el Vue实例挂载的dom节点
        data: {
            tasklist: [
                { id: 1, pic: './images/01.gif', name: '咪咕视频送流量', desc: '来咪咕视频,每月领500MB流量奖励', status: 1 },
                { id: 2, pic: './images/02.gif', name: '和彩云送福利', desc: '免费领100G空间+月月2GB', status: 2 },
                { id: 3, pic: './images/03.gif', name: '最高40元套餐折扣券', desc: '参与抽奖,奖励10MB,经验值+10', status: 2},
                { id: 4, pic: './images/04.gif', name: '吃喝玩乐季，超级秒杀', desc: '进入隐藏二楼参与秒杀,奖励10MB,经验值+10', status: 3 },
            ]
        },//data定义响应式数据，data的类型是对象，也可以是函数
        computed: {}, //computed 定义计算属性
        watch: {}, //watch 定义数据监听
        methods: {}, //methods 定义方法(函数)
        filters: {}, //filters 定义过滤器
        directives: {}, //directives 定义自定义指令
        components: {}, //components 注册局部组件
    })
</script>